package hibernate;

import org.hibernate.HibernateException;

/**
 *
 * @author Thorsten Ludwig
 */
public class FixedDialect extends org.hibernate.dialect.DerbyDialect {
    
    public FixedDialect() {
      super();
    }

   @Override
   public String getTypeName(final int code, final int length, final int precision, final int scale) throws HibernateException {

      String typeName = super.getTypeName(code, length, precision, scale);

      // test if it is serialiable type (-3)
      if (code == -3) {
         typeName = "LONG VARCHAR FOR BIT DATA";
      }

      return typeName;
   }
}
